<!DOCTYPE html>


  <html class="dark page-post">


<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  
  <title>React Native之iOS打包发布 | Poetry&#39;s Blog</title>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  
    <meta name="keywords" content="react,RN,">
  

  <meta name="description" content="结合这篇文章一起看 http://blog.poetries.top/2019/10/07/Ionic-ios-build   React Native 应用程序开发完成后，需要先打包一个测试版，由测试人员安装应用并测试。对于 iOS 应用，一般来说，开发者如果需要将应用安装到某些用户的设备上，就需要将应用导出为这些设备可以直接安装的安装包（.ipa 文件）。本文总结了如何打包 ipa 并发布到">
<meta name="keywords" content="react,RN">
<meta property="og:type" content="article">
<meta property="og:title" content="React Native之iOS打包发布">
<meta property="og:url" content="http://blog.poetries.top/2019/10/03/rn-ios-distribute/index.html">
<meta property="og:site_name" content="Poetry&#39;s Blog">
<meta property="og:description" content="结合这篇文章一起看 http://blog.poetries.top/2019/10/07/Ionic-ios-build   React Native 应用程序开发完成后，需要先打包一个测试版，由测试人员安装应用并测试。对于 iOS 应用，一般来说，开发者如果需要将应用安装到某些用户的设备上，就需要将应用导出为这些设备可以直接安装的安装包（.ipa 文件）。本文总结了如何打包 ipa 并发布到">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/711.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/712.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/713.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/714.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/715.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/726.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/727.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/728.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/729.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/730.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/731.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/732.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/733.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/734.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/735.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/736.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/737.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/738.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/739.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/740.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/741.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/742.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/743.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/716.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/717.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/718.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/719.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/720.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/721.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/ionic/16.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/ionic/17.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/ionic/18.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/ionic/19.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/725.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/709.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/710.png">
<meta property="og:updated_time" content="2020-08-15T04:25:31.934Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="React Native之iOS打包发布">
<meta name="twitter:description" content="结合这篇文章一起看 http://blog.poetries.top/2019/10/07/Ionic-ios-build   React Native 应用程序开发完成后，需要先打包一个测试版，由测试人员安装应用并测试。对于 iOS 应用，一般来说，开发者如果需要将应用安装到某些用户的设备上，就需要将应用导出为这些设备可以直接安装的安装包（.ipa 文件）。本文总结了如何打包 ipa 并发布到">
<meta name="twitter:image" content="https://poetries1.gitee.io/img-repo/2019/10/711.png">

  

  
    <link rel="icon" href="/favicon.ico">
  

  <link href="/css/styles.css?v=c114cbeddx" rel="stylesheet">
<link href="/css/other.css?v=c114cbeddx" rel="stylesheet">


  
    <link rel="stylesheet" href="/css/personal-style.css">
  

  

  
  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?40b1f89aa80f2527b3db779c6898c879";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>


  
  <script type="text/javascript">
	(function(){
	    var bp = document.createElement('script');
	    var curProtocol = window.location.protocol.split(':')[0];
	    if (curProtocol === 'https') {
	        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
	    }
	    else {
	        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
	    }
	    var s = document.getElementsByTagName("script")[0];
	    s.parentNode.insertBefore(bp, s);
	})();
  </script>



  
    <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.3.0/css/font-awesome.min.css">
  

  <!-- 聊天系统 -->
  
    
   <link type="text/css" rel="stylesheet" href="/renxi/default.css">
   <style>
      #modal {
        position: static !important;
      }
      .filter {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: #fe5757;
        animation: colorChange 30s ease-in-out infinite;
        animation-fill-mode: both;
        mix-blend-mode: overlay;
      }
  
      @keyframes colorChange {
        0%, 100% {
            opacity: 0;
        }
        50% {
            opacity: .9;
        }
      }
   </style>
</head>
</html>
<body>
  
  
    <span id="toolbox-mobile" class="toolbox-mobile">导航</span>
  

  <div class="post-header CENTER">
   
  <div class="toolbox">
    <a class="toolbox-entry" href="/">
      <span class="toolbox-entry-text">导航</span>
      <i class="icon-angle-down"></i>
      <i class="icon-home"></i>
    </a>
    <ul class="list-toolbox">
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/archives/"
            rel="noopener noreferrer"
            target="_self"
            >
            博客
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/categories/"
            rel="noopener noreferrer"
            target="_self"
            >
            分类
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/tags/"
            rel="noopener noreferrer"
            target="_self"
            >
            标签
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/search/"
            rel="noopener noreferrer"
            target="_self"
            >
            搜索
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/link/"
            rel="noopener noreferrer"
            target="_self"
            >
            友链
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/about/"
            rel="noopener noreferrer"
            target="_self"
            >
            关于
          </a>
        </li>
      
    </ul>
  </div>


</div>


  <div id="toc" class="toc-article">
    <strong class="toc-title">文章目录<i class="iconfont toc-title" style="display:inline-block;color:#87998d;width:20px;height:20px;">&#xf004b;</i></strong>
    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#一、应用程序打包"><span class="toc-text">一、应用程序打包</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-1-打包离线资源"><span class="toc-text">1.1 打包离线资源</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#1-2-添加离线资源到项目中"><span class="toc-text">1.2 添加离线资源到项目中</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#1-3-修改-AppDelegate-m-文件"><span class="toc-text">1.3 修改 AppDelegate.m 文件</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#二、iOS证书配置"><span class="toc-text">二、iOS证书配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#三、Xcode-打包-ipa"><span class="toc-text">三、Xcode 打包 ipa</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#四、发布到内测分发平台"><span class="toc-text">四、发布到内测分发平台</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#4-1-ipa安装到手机上"><span class="toc-text">4.1 ipa安装到手机上</span></a></li></ol></li></ol>
  </div>
  




<div class="content content-post CENTER">
   <!-- canvas 彩带 -->
<canvas id="evanyou" width="1302" height="678" style="position: fixed;width: 100%;height: 100%;top: 0;left:0;z-index:-1;"></canvas>

<article id="post-rn-ios-distribute" class="article article-type-post" itemprop="blogPost">
  <header class="article-header" style="position:relative;">
    <h1 class="post-title">React Native之iOS打包发布</h1>

    <div class="article-meta">
      <span>
        <i class="icon-calendar"></i>
        <span>2019.10.04</span>
      </span>

      
        <span class="article-author">
          <i class="icon-user"></i>
          <span>Poetry</span>
        </span>
      

      
  <span class="article-category">
    <i class="icon-list"></i>
    <a class="article-category-link" href="/categories/Front-End/">Front-End</a>
  </span>



      

      
      <i class="fa fa-eye"></i> 
        <span id="busuanzi_container_page_pv">
           &nbsp热度 <span id="busuanzi_value_page_pv">
           <i class="fa fa-spinner fa-spin"></i></span>℃
        </span>
      
      
       
          <span class="post-count">
            <i class="fa fa-file-word-o"></i>&nbsp
            <span>字数统计 1.1k字</span>
          </span>

          <span class="post-count">
            <i class="fa fa-columns"></i>&nbsp
            <span>阅读时长 4分</span>
          </span>
      
      
    </div>

    <i class="iconfont" id="toc-eye" style="display:inline-block;color:#b36619;position:absolute;top:0;right:0;cursor:pointer;
    font-size: 24px;">&#xe61c;</i>

  </header>

  <div class="article-content">
    
      <div id="container">
        <blockquote>
<p>结合这篇文章一起看 <a href="http://blog.poetries.top/2019/10/07/Ionic-ios-build">http://blog.poetries.top/2019/10/07/Ionic-ios-build</a></p>
</blockquote>
<blockquote>
<p><code>React Native</code> 应用程序开发完成后，需要先打包一个测试版，由测试人员安装应用并测试。对于 <code>iOS</code> 应用，一般来说，开发者如果需要将应用安装到某些用户的设备上，就需要将应用导出为这些设备可以直接安装的安装包（<code>.ipa</code> 文件）。本文总结了如何打包 <code>ipa</code> 并发布到应用内测分发平台供安装测试</p>
</blockquote>
<h2 id="一、应用程序打包"><a href="#一、应用程序打包" class="headerlink" title="一、应用程序打包"></a>一、应用程序打包</h2><blockquote>
<p>开发 <code>React Native</code> 应用时，js 代码和图片资源通过 <code>Debug Server</code> 提供，但是当我们需要发布应用时，就需要将 js 等资源和应用一起打包</p>
</blockquote>
<h3 id="1-1-打包离线资源"><a href="#1-1-打包离线资源" class="headerlink" title="1.1 打包离线资源"></a>1.1 打包离线资源</h3><blockquote>
<p>通过 <code>react-native bundle</code> 命令可以打包离线资源。为了日后把打包方便，我们把打包指令填在下<code>package.json</code>下</p>
</blockquote>
<figure class="highlight"><table><tr><td class="code"><pre><span class="line">"scripts": &#123;</span><br><span class="line">    "start": "node node_modules/react-native/local-cli/cli.js start",</span><br><span class="line">    "test": "jest",</span><br><span class="line">    "bundle-ios": "node node_modules/react-native/local-cli/cli.js bundle --entry-file index.js --platform ios --dev false --bundle-output ./ios/bundle/index.jsbundle --assets-dest ./ios/bundle"</span><br><span class="line">  &#125;,</span><br></pre></td></tr></table></figure>
<blockquote>
<p><code>bundle-ios</code>命令参数含义</p>
</blockquote>
<ul>
<li><code>--entry-file</code>：入口文件。</li>
<li><code>--platform</code>：平台名称（ios或者android）。</li>
<li><code>--dev</code>：是否是开发模式，设置为 false 的时候将会对 JavaScript 代码进行优化处理。</li>
<li><code>--bundle-output</code>：生成的 <code>jsbundle</code> 文件的名称。</li>
<li><code>--assets-dest</code>：图片以及其他资源存放的目录</li>
</ul>
<blockquote>
<p>这样打包只需要在根目录下输入<code>npm run bundle-ios</code> 即可（切记一定要先在<code>项目--&gt;ios下新建bundle</code>文件夹，不然会报错）</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/711.png" alt></p>
<blockquote>
<p>之后你会发现bundle文件下面已经有了内容（如下图）</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/712.png" alt></p>
<h3 id="1-2-添加离线资源到项目中"><a href="#1-2-添加离线资源到项目中" class="headerlink" title="1.2 添加离线资源到项目中"></a>1.2 添加离线资源到项目中</h3><blockquote>
<p>在<code>Xcode</code>中添加资源到项目中，必须使用<code>Create folder references</code>的方式(也就是文件夹的方式)添加<code>bundle</code>文件<br>夹</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/713.png" alt></p>
<blockquote>
<p>必须使用<code>Create folder references</code>的方式添加：</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/714.png" alt></p>
<blockquote>
<p>添加成功后<code>bundle</code>文件夹为蓝色（如下图）</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/715.png" alt></p>
<h3 id="1-3-修改-AppDelegate-m-文件"><a href="#1-3-修改-AppDelegate-m-文件" class="headerlink" title="1.3 修改 AppDelegate.m 文件"></a>1.3 修改 AppDelegate.m 文件</h3><blockquote>
<p>在开发的过程中可以在这里配置<code>Debug Server</code>的地址，当发布上线的时候，就需要使用离线的<code>jsbundle</code>文件，因此需要设置<code>jsCodeLocation</code>为本地的离线<code>jsbundle</code>。</p>
</blockquote>
<figure class="highlight c"><table><tr><td class="code"><pre><span class="line">- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions</span><br><span class="line">&#123;</span><br><span class="line">  NSURL *jsCodeLocation;</span><br><span class="line"></span><br><span class="line"><span class="comment">//  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];</span></span><br><span class="line"><span class="comment">//  jsCodeLocation = [NSURL URLWithString:@"http://192.0.0.0:8081/index.bundle?platform=ios&amp;dev=true"];//真机Hot reloading</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> DEBUG</span></span><br><span class="line">     jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@<span class="string">"index"</span> fallbackResource:nil];<span class="comment">//开发调试</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">else</span></span></span><br><span class="line">    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@<span class="string">"bundle/index"</span> withExtension:@<span class="string">"jsbundle"</span>];<span class="comment">//上线打包</span></span><br><span class="line">  </span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span></span></span><br><span class="line"> ........</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="二、iOS证书配置"><a href="#二、iOS证书配置" class="headerlink" title="二、iOS证书配置"></a>二、iOS证书配置</h2><blockquote>
<p>建议阅读这篇文章更详细。<a href="http://blog.poetries.top/2019/10/03/rn-ios-cert-config">React Native打包前凑之iOS证书配置</a></p>
</blockquote>
<blockquote>
<p>首先你的有一个开发者账号才可以进行以下步骤</p>
</blockquote>
<blockquote>
<p>在mac上搜索钥匙串打开</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/726.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/727.png" alt></p>
<blockquote>
<p>到 <code>https://developer.apple.com</code> 去申请证书</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/728.png" alt></p>
<blockquote>
<p>新建证书</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/729.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/730.png" alt></p>
<blockquote>
<p>上传之前的钥匙串文件</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/731.png" alt></p>
<blockquote>
<p>下载证书。双击即可安装到钥匙串中</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/732.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/733.png" alt></p>
<blockquote>
<p>新建<code>Identifiers</code></p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/734.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/735.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/736.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/737.png" alt></p>
<blockquote>
<p>新增Profiles 把设备证书以及id关联起来</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/738.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/739.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/740.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/741.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/742.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/743.png" alt></p>
<blockquote>
<p>到此证书部分添加完毕。接下来是根据已经配置的证书去打包。xcode会自动同步证书信息过来</p>
</blockquote>
<h2 id="三、Xcode-打包-ipa"><a href="#三、Xcode-打包-ipa" class="headerlink" title="三、Xcode 打包 ipa"></a>三、Xcode 打包 ipa</h2><ol>
<li>在 <code>Xcode</code> 添加前面申请证书的开发者账号（<code>Xcode-&gt;Preferences-&gt;Accounts</code>）</li>
</ol>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/716.png" alt></p>
<ol start="2">
<li>这里的 <code>Bundle Idetifier</code> 应该为之前在开发者平台上添加的 <code>App ID</code> 如下图</li>
</ol>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/717.png" alt></p>
<ol start="3">
<li>配置一下<code>code sign</code> 。选择 <code>Code Signing Identity</code> 安装证书</li>
</ol>
<blockquote>
<p>程序会自动选择设置</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/718.png" alt></p>
<blockquote>
<p>或者手动选择证书</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/719.png" alt></p>
<ol start="4">
<li>点击设备，选择通用 iOS 设备</li>
</ol>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/720.png" alt></p>
<ol start="5">
<li>点击 <code>Product-&gt;Archive</code> 开始打包</li>
</ol>
<blockquote>
<p>打包完成后如下</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/721.png" alt></p>
<blockquote>
<p>点击<code>distribute App</code></p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/ionic/16.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/ionic/17.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/ionic/18.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/ionic/19.png" alt></p>
<blockquote>
<p>最后打包成<code>ipa</code>文件</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/725.png" alt></p>
<h2 id="四、发布到内测分发平台"><a href="#四、发布到内测分发平台" class="headerlink" title="四、发布到内测分发平台"></a>四、发布到内测分发平台</h2><blockquote>
<p>由于新版的 iTunes 没有了应用程序选项，所以无法通过 iTunes 安装 App 到手机中。比较方便的方式是将应用发布到内测分发平台，然后扫码即可下载。目前我听得比较多的平台就是蒲公英和 fir.im，不过这两个平台都需要实名认证，有点蛋疼。具体使用哪个平台自己甄选就行，这里推荐一个不需要认证的国外平台 <a href="https://www.diawi.com" target="_blank" rel="noopener">https://www.diawi.com</a></p>
</blockquote>
<h3 id="4-1-ipa安装到手机上"><a href="#4-1-ipa安装到手机上" class="headerlink" title="4.1 ipa安装到手机上"></a>4.1 ipa安装到手机上</h3><blockquote>
<p>在Xcode的导航栏上选择<code>window-&gt;Devices and Simulators</code>，点击弹出页面里面的+号，选择<code>ipa</code>所在的文件夹,添加<code>ipa</code>，安装成功</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/709.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/710.png" alt></p>
<blockquote>
<p>以上只是测试版本打包，打包成<code>disctibute App</code>发布版本同理，这里不再赘述</p>
</blockquote>

      </div>
    
  </div>

</article>

<button class="assist-btn2 circle" id="assist_btn2" title="点亮屏幕" style="left: 27px; top: 152px;">
  <i class="iconfont" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>
<button class="assist-btn1 circle" id="assist_btn1" title="关闭屏幕亮度" style="left: 27px; top: 152px;">
  <i class="iconfont toc-title" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>


<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>	

<script src="https://my.openwrite.cn/js/readmore.js" type="text/javascript"></script>
<script>
  const btw = new BTWPlugin();
  btw.init({
    id: "container",
    blogId: "22699-1592137983091-414",
    name: "前端进阶之旅",
    qrcode: "https://poetries1.gitee.io/img-repo/2020/06/qrcode.jpg",
    keyword: "3a3b3c",
  });
</script>

<script type="text/javascript">

// white theme
var body = {color: "#555", background: "#000"};
var a_tag = {color: "#222"};
var header = { background: "#222"};
var logo_line_i = {background: "#222"};
// var post_code = {background: "#eee", color: "#222"};

function switch_theme() {
 $("body").css(body);
 $("a:not('.links-of-author-item a, .site-state-item a, .site-state-posts a, .feed-link a, .motion-element a, .post-tags a, .show-commit-cls a, #donate_board a')").css(a_tag);
 $(".header, .footer").css(header);
 $(".logo-line-before i, .logo-line-after i").css(logo_line_i);
 //$(".post code").css(post_code);
 $("#idhyt-surprise-ball #idhyt-surprise-ball-animation .drag").css(a_tag);
 $(".post-title-link, .posts-expand .post-meta, .post-comments-count, .disqus-comment-count, .post-category a, .post-nav-next a, .post-nav-item a").css(a_tag);
 
 // $("code").css({color: '#c5c8c6', background: '#1d1f21'});
 //$("#assist_btn1").hide(1500);
}

$(function () {
$("#assist_btn2").css("display","none");
 $("#assist_btn1").click(function() {
     switch_theme();
$("div#toc.toc-article").css({
 "background":"#eaeaea",
 "opacity":1
});
$(".toc-article ol").show();
$("#toc.toc-article .toc-title").css("color","#a98602");
$("#assist_btn1").css("display","none");
$("#assist_btn2").css("display","block");
 });
$("#assist_btn2").click(function() {
$("#assist_btn2").css("display","none");
$("#assist_btn1").css("display","block");
$("body").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
     $(".header, .footer").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
$(".toc-article ol").toggle(1000);
 });
});


//背景随机

var Y, O, E, L, B, C, T, z, N, S, A, I;
!function() {
var e = function() {
for (O.clearRect(0, 0, L, B), T = [{
x: 0,
y: .7 * B + C
}, {
x: 0,
y: .7 * B - C
}]; T[1].x < L + C;) t(T[0], T[1])
}, t = function(e, t) {
O.beginPath(), O.moveTo(e.x, e.y), O.lineTo(t.x, t.y);
var n = t.x + (2 * I() - .25) * C,
 r = a(t.y);
O.lineTo(n, r), O.closePath(), N -= S / -50, O.fillStyle = "#" + (127 * A(N) + 128 << 16 | 127 * A(N + S / 3) + 128 << 8 | 127 * A(N + S / 3 * 2) + 128).toString(16), O.fill(), T[0] = T[1], T[1] = {
 x: n,
 y: r
}
}, a = function n(e) {
var t = e + (2 * I() - 1.1) * C;
return t > B || t < 0 ? n(e) : t
};
Y = document.getElementById("evanyou"), O = Y.getContext("2d"), E = window.devicePixelRatio || 1, L = window.innerWidth, B = window.innerHeight, C = 90, z = Math, N = 0, S = 2 * z.PI, A = z.cos, I = z.random, Y.width = L * E, Y.height = B * E, O.scale(E, E), O.globalAlpha = .6, document.onclick = e, document.ontouchstart = e, e()
}()

   
$("#toc-eye").click(function(){
$("#toc.toc-article").toggle(1000);
});

</script>


   
  <div class="text-center donation">
    <div class="inner-donation">
      <span class="btn-donation">支持一下</span>
      <div class="donation-body">
        <div class="tip text-center">扫一扫，支持poetries</div>
        <ul>
        
          <li class="item">
            
              <span>微信扫一扫</span>
            
            <img src="/images/weixin.jpg" alt="">
          </li>
        
          <li class="item">
            
              <span>支付宝扫一扫</span>
            
            <img src="/images/zhifubao.jpg" alt="">
          </li>
        
        </ul>
      </div>
    </div>
  </div>


   
  <div class="box-prev-next clearfix">
    <a class="show pull-left" href="/2019/10/03/rn-ios-cert-config/">
        <i class="icon icon-angle-left"></i>
    </a>
    <a class="show pull-right" href="/2019/10/04/rn-icon-spash-setting/">
        <i class="icon icon-angle-right"></i>
    </a>
  </div>




</div>


  <a id="backTop" class="back-top">
    <i class="icon-angle-up"></i>
  </a>




  <div class="modal" id="modal">
  <span id="cover" class="cover hide"></span>
  <div id="modal-dialog" class="modal-dialog hide-dialog">
    <div class="modal-header">
      <span id="close" class="btn-close">关闭</span>
    </div>
    <hr>
    <div class="modal-body">
      <ul class="list-toolbox">
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/archives/"
              rel="noopener noreferrer"
              target="_self"
              >
              博客
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/categories/"
              rel="noopener noreferrer"
              target="_self"
              >
              分类
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/tags/"
              rel="noopener noreferrer"
              target="_self"
              >
              标签
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/search/"
              rel="noopener noreferrer"
              target="_self"
              >
              搜索
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/link/"
              rel="noopener noreferrer"
              target="_self"
              >
              友链
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/about/"
              rel="noopener noreferrer"
              target="_self"
              >
              关于
            </a>
          </li>
        
      </ul>

    </div>
  </div>
</div>



  
      <div class="fexo-comments comments-post">
    

    

    
    

    

    
    

    

<!-- Gitalk评论插件通用代码 -->
<div id="gitalk-container"></div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script>
const gitalk = new Gitalk({
  clientID: '5567a2c4abb858009d96',
  clientSecret: 'b9039ec056cf5c2346b3cdb63308a28c163f91e5',
  repo: 'poetries.github.io',
  owner: 'poetries',
  // 在这里设置一下截取前50个字符串, 这是因为 github 对 label 的长度有了要求, 如果超过
  // 50个字符串则会报错.
  // id: location.pathname.split('/').pop().substring(0, 49),
  id: location.pathname,
  admin: ['poetries'],
  // facebook-like distraction free mode
  distractionFreeMode: false
})
gitalk.render('gitalk-container')
</script>
<!-- Gitalk代码结束 -->



  </div>

  

  <script type="text/javascript">
  function loadScript(url, callback) {
    var script = document.createElement('script')
    script.type = 'text/javascript';

    if (script.readyState) { //IE
      script.onreadystatechange = function() {
        if (script.readyState == 'loaded' ||
          script.readyState == 'complete') {
          script.onreadystatechange = null;
          callback();
        }
      };
    } else { //Others
      script.onload = function() {
        callback();
      };
    }

    script.src = url;
    document.getElementsByTagName('head')[0].appendChild(script);
  }

  window.onload = function() {
    loadScript('/js/bundle.js?235683', function() {
      // load success
    });
  }
</script>


  <!-- 页面点击小红心 -->
  <script type="text/javascript" src="/js/clicklove.js"></script>
 
  
</body>
</html>
